<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>后台</title>
<link type="text/css" rel="stylesheet" href="<%=basePath %>jquery-easyui-1.4.2/themes/default/easyui.css">
<link type="text/css" rel="stylesheet" href="<%=basePath %>jquery-easyui-1.4.2/themes/icon.css">
<script type="text/javascript" src="<%=basePath %>js/jquery-2.1.1.min.js"></script>
<script type="text/javascript" src="<%=basePath %>jquery-easyui-1.4.2/jquery.easyui.min.js"></script>
<script type="text/javascript" src="<%=basePath %>jquery-easyui-1.4.2/locale/easyui-lang-zh_CN.js"></script>
<script type="text/javascript">
	function addTab(title, url) {
		if ($('#center').tabs('exists', title)) {
			$('#center').tabs('select', title);
			// 更新选择的面板的新标题和内容
			var tab = $('#center').tabs('getSelected');  // 获取选择的面板
			$('#center').tabs('update', {
				tab: tab,
				options: {}
			});
		} else {
			$('#center').tabs('add', {
				title : title,
				selected : true,
				closable : true,
				style:{padding:"10px"},
				content:'<iframe src="'+url+'" height="99%"  width="100%"  scrolling="auto" frameborder="0"></iframe>'
			});
		}
	/* 	// 调用 'refresh' 方法更新选项卡面板的内容
		var tab = $('#center').tabs('getSelected');  // 获取选择的面板
		tab.panel('refresh', url); */
	}
</script>
</head>

<body class="easyui-layout">
    <div data-options="region:'west',title:'知识管理'" collapsible="false" style="width:200px;">
		<ul id="tt" class="easyui-tree" >
			<c:forEach items="${menus}" var="m1">
				<c:if test="${m1.menuLevel==1 }">
					<li>
						<span><a href="Javascript:addTab('${m1.menuname}','<%=basePath %>nuiiqk/${m1.menuUrl}');">${m1.menuname }</a></span>
							<ul>
								<c:forEach items="${menus}" var="m2">
									<c:if test="${m2.menuLevel==2 && m2.menuparentld == m1.menuid}">
										<li><span>${m2.menuname}</span>
											<ul>
												<c:forEach items="${menus}" var="m3">
													<c:if test="${m3.menuLevel==3 && m3.menuparentld == m2.menuid }">
															<li>${m3.menuname}</li>
													</c:if>
												</c:forEach>
											</ul>
										</li>
									</c:if>
								</c:forEach>
							</ul>
					</li>
				</c:if>
			</c:forEach>
		</ul>
    </div>   
    <div data-options="region:'center'"id="center" class="easyui-tabs">
	   <div title="欢迎进入" style="padding: 20px; display: blick;">欢迎您。。。</div>
	</div>
</body>
</html>
